# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportDataConfig do
  @moduledoc """
  Describes what part of the Dataset is to be exported, the destination of the export and how to export.

  ## Attributes

  *   `annotationSchemaUri` (*type:* `String.t`, *default:* `nil`) - The Cloud Storage URI that points to a YAML file describing the annotation schema. The schema is defined as an OpenAPI 3.0.2 [Schema Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). The schema files that can be used here are found in gs://google-cloud-aiplatform/schema/dataset/annotation/, note that the chosen schema must be consistent with metadata of the Dataset specified by ExportDataRequest.name. Only used for custom training data export use cases. Only applicable to Datasets that have DataItems and Annotations. Only Annotations that both match this schema and belong to DataItems not ignored by the split method are used in respectively training, validation or test role, depending on the role of the DataItem they are on. When used in conjunction with annotations_filter, the Annotations used for training are filtered by both annotations_filter and annotation_schema_uri.
  *   `annotationsFilter` (*type:* `String.t`, *default:* `nil`) - An expression for filtering what part of the Dataset is to be exported. Only Annotations that match this filter will be exported. The filter syntax is the same as in ListAnnotations.
  *   `exportUse` (*type:* `String.t`, *default:* `nil`) - Indicates the usage of the exported files.
  *   `filterSplit` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFilterSplit.t`, *default:* `nil`) - Split based on the provided filters for each set.
  *   `fractionSplit` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFractionSplit.t`, *default:* `nil`) - Split based on fractions defining the size of each set.
  *   `gcsDestination` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t`, *default:* `nil`) - The Google Cloud Storage location where the output is to be written to. In the given directory a new directory will be created with name: `export-data--` where timestamp is in YYYY-MM-DDThh:mm:ss.sssZ ISO-8601 format. All export output will be written into that directory. Inside that directory, annotations with the same schema will be grouped into sub directories which are named with the corresponding annotations' schema title. Inside these sub directories, a schema.yaml will be created to describe the output format.
  *   `savedQueryId` (*type:* `String.t`, *default:* `nil`) - The ID of a SavedQuery (annotation set) under the Dataset specified by ExportDataRequest.name used for filtering Annotations for training. Only used for custom training data export use cases. Only applicable to Datasets that have SavedQueries. Only Annotations that are associated with this SavedQuery are used in respectively training. When used in conjunction with annotations_filter, the Annotations used for training are filtered by both saved_query_id and annotations_filter. Only one of saved_query_id and annotation_schema_uri should be specified as both of them represent the same thing: problem type.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :annotationSchemaUri => String.t() | nil,
          :annotationsFilter => String.t() | nil,
          :exportUse => String.t() | nil,
          :filterSplit =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFilterSplit.t() | nil,
          :fractionSplit =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFractionSplit.t() | nil,
          :gcsDestination =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination.t() | nil,
          :savedQueryId => String.t() | nil
        }

  field(:annotationSchemaUri)
  field(:annotationsFilter)
  field(:exportUse)
  field(:filterSplit, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFilterSplit)

  field(:fractionSplit,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportFractionSplit
  )

  field(:gcsDestination, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1GcsDestination)
  field(:savedQueryId)
end

defimpl Poison.Decoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportDataConfig do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportDataConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1ExportDataConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
